/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cl.ipla.web.actions;

import cl.ipla.web.actionforms.LoginActionForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForward;

/**
 *
 * @author papa
 */
public class ControlAction extends org.apache.struts.action.Action {
  
    
    public ActionForward execute(ActionMapping mapping, ActionForm  form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        
        String destino="";
    LoginActionForm miform=(LoginActionForm)form;
    String accion=miform.getAccion()!=null?miform.getAccion():"";
    if (accion.equalsIgnoreCase("")){
        //destino="RegistroUsuario";
        destino="Inicio";
    }if (accion.equalsIgnoreCase("RegistrarUsuario")){
        destino="RegistroUsuario";
    }
        
        
        return mapping.findForward(destino);
        
    }
}